GtkCTree *ctree;
GdkGCValues values;
- ctree = GTK_CTREE (widget);
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_CTREE (widget));
(* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
+ ctree = GTK_CTREE (widget);
+
values.foreground = widget->style->fg[GTK_STATE_NORMAL];
values.background = widget->style->bg[GTK_STATE_NORMAL];
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
{
GtkCTree *ctree;
- ctree = GTK_CTREE (widget);
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_CTREE (widget));
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
+ ctree = GTK_CTREE (widget);
+
gdk_gc_destroy (ctree->lines_gc);
if (ctree->reorderable)
clist = GTK_CLIST (ctree);
- if (update_focus_row && clist->selection_mode == GTK_SELECTION_BROWSE)
+ if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
{
if (clist->anchor != -1)
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
clist = GTK_CLIST (ctree);
- if (update_focus_row && clist->selection_mode == GTK_SELECTION_BROWSE)
+ if (update_focus_row && clist->selection_mode == GTK_SELECTION_EXTENDED)
{
if (clist->anchor != -1)
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
clist = GTK_CLIST (ctree);
- if (clist->selection_mode == GTK_SELECTION_BROWSE)
+ if (clist->selection_mode == GTK_SELECTION_EXTENDED)
{
if (clist->anchor != -1)
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
gboolean node_selected;
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
if (!node)
return;
GtkCList *clist;
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
if (!node)
return;
if (node && GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_UNSELECT_ROW],
node, column);
- else
+ else if (node)
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_SELECT_ROW],
node, column);
break;
{
GtkCTreeRow *work;
+ g_return_val_if_fail (ctree != NULL, FALSE);
+ g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE);
+ g_return_val_if_fail (node != NULL, FALSE);
+
work = GTK_CTREE_ROW (node);
while (work->parent && GTK_CTREE_ROW (work->parent)->expanded)
gtk_ctree_last (GtkCTree *ctree,
GList *node)
{
+ g_return_val_if_fail (ctree != NULL, NULL);
+ g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL);
+
if (!node)
return NULL;
GList *new_sibling)
{
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
g_return_if_fail (node != NULL);
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_MOVE], node,
GList *node)
{
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
g_return_if_fail (node != NULL);
if (GTK_CTREE_ROW (node)->is_leaf)
GList *node)
{
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
g_return_if_fail (node != NULL);
if (GTK_CTREE_ROW (node)->is_leaf)
GList *node)
{
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
g_return_if_fail (node != NULL);
if (GTK_CTREE_ROW (node)->is_leaf)
gboolean thaw = FALSE;
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
if (node && GTK_CTREE_ROW (node)->is_leaf)
return;
GList *node)
{
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
g_return_if_fail (node != NULL);
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_SELECT_ROW],
GList *node)
{
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
g_return_if_fail (node != NULL);
gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_UNSELECT_ROW],
gboolean thaw = FALSE;
g_return_if_fail (ctree != NULL);
+ g_return_if_fail (GTK_IS_CTREE (ctree));
clist = GTK_CLIST (ctree);
thaw = TRUE;
}
- if (clist->selection_mode == GTK_SELECTION_BROWSE)
+ if (clist->selection_mode == GTK_SELECTION_EXTENDED)
{
if (clist->anchor != -1)
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
clist->undo_unselection = NULL;
}
- if (gtk_ctree_is_visible (ctree, node))
+ if (node && gtk_ctree_is_visible (ctree, node))
focus_node = g_list_nth (clist->row_list, clist->focus_row);
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_sort), NULL);
thaw = TRUE;
}
- if (clist->selection_mode == GTK_SELECTION_BROWSE)
+ if (clist->selection_mode == GTK_SELECTION_EXTENDED)
{
if (clist->anchor != -1)
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
clist->undo_unselection = NULL;
}
- if (gtk_ctree_is_visible (ctree, node))
+ if (node && gtk_ctree_is_visible (ctree, node))
focus_node = g_list_nth (clist->row_list, clist->focus_row);
tree_sort (ctree, node, NULL);
gboolean thaw = FALSE;
gboolean unselect;
+ g_return_if_fail (clist != NULL);
+ g_return_if_fail (GTK_IS_CTREE (clist));
+
if (clist->anchor < 0)
return;
GtkCTree *ctree;
GList *work;
-
g_return_if_fail (clist != NULL);
- g_return_if_fail (GTK_IS_CLIST (clist));
+ g_return_if_fail (GTK_IS_CTREE (clist));
if (clist->selection_mode != GTK_SELECTION_EXTENDED)
return;